﻿using SoldiHive.Core.Cache;
using SoldiHive.Core.NodeJs;
using SoldiHive.Core.Parsing;
using SoldiHive.Core.Ratings;
using SoldiHive.Model;

namespace SoldiHive.Core.Adapters
{
	public class YahooAdapter : BaseAdapter
	{
		private const string GET_ANALYST_OPINION_SCRIPT = "yahoo_getanalystopinions.js";

		public override Site Source
		{
			get 
			{
				return Site.Yahoo;
			}
		}

		public YahooAdapter(IScriptExecutor scriptExecutor, IParser parser, IRatingStrategy ratingStrategy, ICache cache, IAdapterConfiguration configuration)
			: base(scriptExecutor, parser, ratingStrategy, cache, configuration)
		{
			
		}

		public override Rating GetRating(Company company)
		{
			var rating = this.GetRating(YahooAdapter.GET_ANALYST_OPINION_SCRIPT, company);

			return rating;
		}
	}
}
